package fr.vvins.core.services;

import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.PathSegment;

import fr.vvins.core.biz.exception.BizException;
import fr.vvins.core.biz.user.dto.UserCommentDto;
import fr.vvins.core.biz.user.dto.UserLogDto;
import fr.vvins.core.biz.user.dto.UserRatingDtoInfo;
import fr.vvins.core.common.TechnicalException;

public interface CommunityService {
	
	/**
	 * Get logs from content
	 * Method : GET
	 * Path /community/logs/content/{id}
	 * @param contentId
	 * @return
	 * @throws BizException
	 * @throws TechnicalException
	 */
	@GET
	@Path("/logs/content/{id}")
	@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
	public Set<UserLogDto> getLogs(@PathParam("id")String contentId) throws BizException, TechnicalException;

	/**
	 * Get logs from content and filter by action type
	 * Method : GET
	 * Path /community/logs/action/{id}/{actionId}
	 * @param contentId
	 * @param actionId
	 * @return
	 * @throws BizException
	 * @throws TechnicalException
	 */
	@GET
	@Path("/logs/action/{id}/{actionId:.*}")
	@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
	public Map<Integer,Set<UserLogDto>> getLogs(@PathParam("id")String contentId, @PathParam("actionId")List<PathSegment> actionId) throws BizException, TechnicalException;

	/**
	 * Get logs from user
	 * Method : GET
	 * Path /community/logs/user/{id}
	 * @param userId
	 * @return
	 * @throws BizException
	 * @throws TechnicalException
	 */
	@GET
	@Path("/logs/user/{id}")
	@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
	public Set<UserLogDto> getLogsByUser(@PathParam("id")String userId) throws BizException, TechnicalException;
	
	/**
	 * Get comment from content
	 * Method : GET
	 * Path /community/comments/content/{id}
	 * @param contentId
	 * @return
	 * @throws BizException
	 * @throws TechnicalException
	 */
	@GET
	@Path("/comments/content/{id}")
	@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
	public Set<UserCommentDto> getComments(@PathParam("id")String contentId) throws BizException, TechnicalException;

	/**
	 * Get comments of a user
	 * Method : GET
	 * Path /community/comments/user/{id}
	 * @param userId
	 * @return
	 * @throws BizException
	 * @throws TechnicalException
	 */
	@GET
	@Path("/comments/user/{id}")
	@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
	public Set<UserCommentDto> getCommentsByUser(@PathParam("id")String userId) throws BizException, TechnicalException;
	
	/**
	 * Get ratings from content
	 * Method : GET
	 * Path /community/ratings/content/{id}
	 * @param contentId
	 * @return
	 * @throws BizException
	 * @throws TechnicalException
	 */
	@GET
	@Path("/ratings/content/{id}")
	@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
	public Set<UserRatingDtoInfo> getRatings(@PathParam("id")String contentId) throws BizException, TechnicalException;

	/**
	 * Get Ratings from user
	 * Method : GET
	 * Path /community/ratings/user/{id}
	 * @param userId
	 * @return
	 * @throws BizException
	 * @throws TechnicalException
	 */
	@GET
	@Path("/ratings/user/{id}")
	@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
	public Set<UserRatingDtoInfo> getRatingsByUser(@PathParam("id")String userId) throws BizException, TechnicalException;
	
	
	
}
